
This readme file summarize the replication code and input data for Deleting a Signal: Evidence from Pre-Employment Credit Checks 
(Bartik and Nelson, ReStat). 

****************************
*** A. REPLICATION FILES ***
****************************

1) 00_master.do calls the following Stata scripts in order:

	* 01_cleanrawCPS.do. This file calls a number of scripts (e.g., 200301to200404.do, 200405to200507.do, etc) that clean 
	  the raw CPS data for a particular range of dates (e.g. Jan 2003 to April 2004, May 2004 to July 2005, etc.), based
	  on changes to CPS raw data formatting over time. These helper scripts are closely based on those distributed by 
	  Jean Roth (NBER) under a GNU GPL license (https://www.nber.org/research/data/current-population-survey-cps-data-nber).

	* 02_buildpanel.do. This file creates CPS panel IDs, sets and checks the panel structure, and does some standard sample
	  selection on CPS data (e.g. excluding ages <=18).

	* 03_prepareregs.do. This file defines state-level treatment and merges in job-level treatment exemptions. The state-
	  level panel is then balanced, and various outcomes and controls are defined. Subsamples are saved as separate 
	  datasets to be used in regression analyses (e.g., recent hires are saved for the separations regression). Finally,
	  state-level economic policy and controls are merged into these datasets.

	* 04_CPSsummarystats.do. This file computes and saves the summary statistics reported in Table 1 and Appendix Table 2. 

	* 05_input_lehd_j2j_all.do.  This file inputs all LEHD J2Jdata.

	* 06_jobfinding.do. This file runs the job-finding regressions reported in Table 2 and Appendix Table 3, and the 
	  event-study plots shown in Figure 2 and Appendix Figure 2.

	* 06b_jobfinding_robustness.do. This file runs the job-finding regressions reported in Appendix Table 8.

	* 06c_jobfinding_months1-4.do. This file runs the job-finding regressions reported in Appendix Table 13.

	* 06d_jobfinding_mimicLEHD.do. This file runs the job-finding regressions reported in Appendix Table 7.

	* 06e_jobfinding_parttime.do. This file runs the job-finding regressions reported in Appendix Table 14.

	* 06f_jobfinding_flexbase.do. This file runs the job-finding regressions reported in Appendix Table 15.

	* 07_jobfinding_subgroup.do. This file runs the job-finding regressions reported in Appendix Table 12.

	* 08_separations.do. This file runs the separations regressions reported in Table 3 and Appendix Table 3, and the
	  event-study plots shown in Figure 3 and Appendix Figure 4. 

	* 08b_separations_placebos.do. This file runs the separations regressions reported in Appendix Table 5.

	* 08c_separations_robustness.do. This file runs the separations regressions reported in Appendix Table 9.

	* 08d_separations_months1-4.do. This file runs the separations regressions reported in Appendix Table 13.

	* 09_wages.do. This file runs the wage regressions reported in Appendix Table 10.

	* 09b_wages_placebos.do. This file runs the wage regressions reported in Appendix Table 11.

	* 10_emp_levels.do. This file runs the employment levels regressions reported in Appendix Table 4.

	* 11_permutationplots.do. This file plots the permutation tests shown in Appendix Figures 5 through 8.

	* 11a_jobfinding_joblevel_permute.do. This file constructs 500 permutation-test samples and estimates 
	  job-finding regressions to be shown in Figure 6. 

	* 11b_jobfinding_statelevel_permute.do. This file constructs 500 permutation-test samples and estimates 
	  job-finding regressions to be shown in Figure 5. 

	* 11c_separations_joblevel_permute.do. This file constructs 500 permutation-test samples and estimates 
	  separations regressions to be shown in Figure 8. 

	* 11d_separations_statelevel_permute.do. This file constructs 500 permutation-test samples and estimates 
	  separations regressions to be shown in Figure 7. 

	* 12a_input_credit.do.  Thie file inputs information on the years different states banned credit credit 
	  checks.

	* 12b_clean_lehd_j2j.  Merges lehd j2j data with credit ban data and cleans resulting data.

	* 12c_merge_policy_controls_lehd.do.  Merges cleaned LEHD J2J/credit ban data with data on state economy 
	  and policy controls.

	* 12d_analysis_state_lehd.do: Produces summary stats on LEHD for Table A1, conducts diff-in-diff and
	  triple-diff analysis of the effect of state bans for Appendix Tables 6 and 7, and produces event-study
	  graphs for Appendix Figure 3.

2) The master Matlab script is sim_signals_caller.m. This file estimates the quantitative version of our model as described 
  in Section 5.5 by calling the following scripts. Outputs from the Stata scripts above are used as target moments. Robustness 
  to different target moments is explored by changing the targets in lines 12-21. The script then produces the counterfactuals
  shown in Table 4. The following scripts are called by sim_signals_caller.m as it searches over parameters:

	* sim_signals.m evaluates model fit for a putative set of parameters.

	* moments.m is called by sim_signals.m and generates model moments for a putative set of parameters.

	* myoutfun*.m allows each call to sim_signals.m to save interim output (e.g. the current parameter vector and 
	  gradient) in case the user wants to monitor this.

3) R_master.R: We have two R-scripts that produce Figures 4 and 5 in the paper.  They need to be run separately after 
   all of the other scripts are run. These files are both contained in the Code/Rscripts folder.

	* robust_graphs_final.R: Produces Figure 4 which reports estimates of the effects of PECCs bans on job-finding 
	  and separations for a variety of specifications.   

	* Model_params_graph.R: Produces Figure 5 which reports the model parameter estimates for the precision of PECCs
	  and non-PECCs signals for different models.



*****************************************
*** B. DATA DICTIONARY AND DATA FILES ***
*****************************************

We use four main input datasets and include them in the tarball XXX:

1) Current Population Survey. Documentation is available from the Census (https://www.census.gov/programs-surveys/cps/data.html) and 
  a summary is provided in the .dct files provided by Jean Roth (NBER) under a GNU GPL license. See https://www.nber.org/research
  /data/current-population-survey-cps-data-nber. We download the CPS raw data from https://www.census.gov/data/datasets/time-series
  /demo/cps/cps-basic.html

2) Job-level variation. As described in the paper, we use statutory text, regulatory guidance, and interpretations from a law 
   firm specializing in human resources, to encode the job-level exemptions from PECC bans in each state's law. These are 
   encoded at the industry and occupation level and saved in exemptionmaster.dta.

3) LEHD J2J data.  Documentation is available from the US census bureau athttps://lehd.ces.census.gov/data/#j2j.  We download the data from: https://lehd.ces.census.gov/data/j2j/.

4) State-level economic and policy controls. These control variables are saved in the following input datasets and are drawn from the
   corresponding papers, as further explained in Appendix Section D.1:

	* State_ban_of_the_box (Doleac and Hansen, 2020)

	* Saiz_HOUSING_SUPPLY.dta (Saiz, 2010)

	* Foreign_Born_2000.dta (2000 Census long form)

	* FrackingShaleState.xls (Bartik et al., 2019)

	* Manufacturing_Shares_2000.dta (2000 Census long form)

	* MedicAidExpKFF.dta (Kaiser Family Foundation)

	* ui_sipp_analysis.dta (Hsu et al., 2018)


***************************
*** C. SOFTWARE VERSIONS***
***************************

Stata 17.0 on Red Hat Enterprise Linux Version 8.7

R 4.2.2 on Mac OS Ventura 13.6.





